/**
 * <p>Project: </p>
 * <p>File: math.h</p>
 * <p>Description: </p>
 * <p>Copyright: Copyright (c) 2016</p>
 * @author 王树根
 * @email: wangshugen@ict.ac.cn
 * @date 2016年6月6日
 */
#ifndef _KERN_MM_MATH_H_
#define _KERN_MM_MATH_H_

#include <defs.h>
#include <assert.h>

// 工具函数
int32_t abs(int32_t n);
int32_t pow(int32_t base, int32_t n);
int32_t pow2(int32_t n);
size_t log(int32_t base, int32_t n);
size_t log2(int32_t n);
size_t log_round_up(int32_t base, int32_t n);
size_t log_round_down(int32_t base, int32_t n);
size_t log2_round_up(int32_t n);
size_t log2_round_down(int32_t n);

#endif /* _KERN_MM_MATH_H_ */
